package com.bsbm.common.service.impl;

import com.bsbm.common.dao.UserDao;
import com.bsbm.common.domain.Role;
import com.bsbm.common.domain.User;
import com.bsbm.common.domain.UserStatus;
import com.bsbm.common.service.UserService;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Created by SABIR IQBAL on 3/27/14.
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public void editUser(User user) {
        userDao.editUser(user);
    }

    @Override
    public void deleteUser(int userId) {
         userDao.deleteUser(userId);
    }

    @Override
    public User findUser(int userId) {
        return userDao.findUser(userId);
    }

    @Override
    public User findByUserName(String userName) {
        return userDao.findByUserName(userName);
    }

    @Override
    public List<User> findAllUser() {
        return userDao.findAllUser();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
